<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<spring:url value="/js/candidato/datigenerali.js" var="jsUrl"></spring:url>
<script src="${jsUrl}" type="text/javascript"></script>
<style>
	.ui-datepicker-trigger { 
		vertical-align:top;
		height:16px;
		width:16px;	
	}
</style>
<div class="unit-row">
	<div class="unit-70" style="width:100%;opacity:0.7;background-color:#FFFFFF;font-weight:bold;">
		<nav class="nav-tabs unit-centered" style="width:1000px">
			<ul>
				<li><span>Dati anagrafici</span></li>
				<c:if test = "${not empty azienda.idAzienda }">
					<li><a href="${flowExecutionUrl}&_eventId=contatti-azienda">Contatti</a></li>	
					<li><a href="${flowExecutionUrl}&_eventId=opportunita-azienda">Opportunit&agrave;</a></li>	
				</c:if>			
				<li><a href="<c:url value="j_spring_security_logout" />">Logout</a></li>
			</ul>
		</nav>
		<br/>
		<c:if test="${not empty datiAnagraficiSalvati}">
			<div class="message message-success">
	    		<span class="close"></span>
	    		Dati salvati con successo
			</div>
		</c:if>
		<c:if test="${not empty requestScope['org.springframework.validation.BindingResult.azienda'].allErrors}">
			<div class="message message-error">
			    <span class="close"></span>
			    Sono presenti degli errori!
			    <c:forEach items="${flowRequestContext.messageContext.allMessages}" var="message">
					<c:if test="${message.source eq 'presente'}">
					      Azienda gi&agrave; presente in archivio!
					</c:if>
 				 </c:forEach>
			</div>
		</c:if>
		<form:form id="datiAnagrafici" method="post" action="${flowExecutionUrl}"
			commandName="azienda" cssClass="forms forms-columnar">
			<form:hidden path="idAzienda"/>
			
			<p class="forms-inline">
				<form:label path="nome" cssErrorClass="error">Nome <em class="req">*</em></form:label>
				<form:input path="nome" cssClass="width-30" maxlength="50"
					cssErrorClass="input-error width-30" />
				<form:errors path="nome" cssClass="error"></form:errors>
			</p>
			
			<p class="forms-inline">
				<form:label path="pIVA" cssErrorClass="error">P.IVA <em class="req">*</em></form:label>
				<form:input path="pIVA" cssClass="width-30" maxlength="50"
					cssErrorClass="input-error width-30" />
				<form:errors path="pIVA" cssClass="error"></form:errors>
			</p>
			
			<p class="forms-inline">
				<form:label path="sitoWeb" cssErrorClass="error">Sito web</form:label>
				<form:input path="sitoWeb" cssClass="width-30" maxlength="50"
					cssErrorClass="input-error width-30" />
				<form:errors path="sitoWeb" cssClass="error"></form:errors>
			</p>
			
			<p class="forms-inline">
				<form:label path="referente" cssErrorClass="error">Referente</form:label>
				<form:input path="referente" cssClass="width-30" maxlength="50"
					cssErrorClass="input-error width-30" />
				<form:errors path="referente" cssClass="error"></form:errors>
			</p>
			
			<p class="forms-inline">
				<form:label path="indirizzoVia" cssErrorClass="error">Indirizzo<em class="req">*</em></form:label>
				<form:input path="indirizzoVia" cssClass="width-30" maxlength="50"
					cssErrorClass="input-error width-30" />
				<form:errors path="indirizzoVia" cssClass="error"></form:errors>
			</p>
			
			<p class="forms-inline">
				<form:label path="indirizzoProvincia" cssErrorClass="error">Provincia<em class="req">*</em></form:label>
				<form:input path="indirizzoProvincia" cssClass="width-30" maxlength="50"
					cssErrorClass="input-error width-30" />
				<form:errors path="indirizzoProvincia" cssClass="error"></form:errors>
			</p>
			
			<p class="forms-inline">
				<form:label path="indirizzoCAP" cssErrorClass="error">CAP<em class="req">*</em></form:label>
				<form:input path="indirizzoCAP" cssClass="width-30" maxlength="50"
					cssErrorClass="input-error width-30" />
				<form:errors path="indirizzoCAP" cssClass="error"></form:errors>
			</p>
			
			<p class="forms-inline">
				<form:label path="indirizzoCitta" cssErrorClass="error">Citt&agrave;<em class="req">*</em></form:label>
				<form:input path="indirizzoCitta" cssClass="width-30" maxlength="50"
					cssErrorClass="input-error width-30" />
				<form:errors path="indirizzoCitta" cssClass="error"></form:errors>
			</p>
			
			
			<p class="forms-inline">
				<form:label path="indirizzoNazione" cssErrorClass="error">Nazione<em class="req">*</em></form:label>
				<form:input path="indirizzoNazione" cssClass="width-30" maxlength="50"
					cssErrorClass="input-error width-30" />
				<form:errors path="indirizzoNazione" cssClass="error"></form:errors>
			</p>
			
			<p class="forms-inline">
				<form:label path="settore" cssErrorClass="error">Settore<em class="req">*</em></form:label>
				<form:input path="settore" cssClass="width-30" maxlength="50"
					cssErrorClass="input-error width-30" />
				<form:errors path="settore" cssClass="error"></form:errors>
			</p>
			
			<p class="forms-inline">
				<form:label path="descrizione" cssErrorClass="error">Descrizione</form:label>
				<form:input path="descrizione" cssClass="width-30" maxlength="50"
					cssErrorClass="input-error width-30" />
				<form:errors path="descrizione" cssClass="error"></form:errors>
			</p>
			
			<p align="right">
				<input type="hidden" name="_eventId" value="saveDatiAnagrafici" >
				<input type="reset" class="btn" value="Annulla">
				<input type="submit" class="btn" value="Salva">
			</p>
		</form:form>
	</div>
</div>

